package com.fly.annotation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author Fly
 * @Description
 * @Date Created in 10:54 2018/1/31
 * @Modified by
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = UniqueClass.class
)
public @interface Unique {

    String message() default "{字段已存在}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
